<!--
Author: Quan Van Sinh
Email : sinhvnb@vietnambiz.com
Mobile: 0972405165
-->
<?php include ADMIN_INCLUDE_DIR."/header.php";?>

<script language="javascript" type="text/javascript">
    var popupImageParams = '&forModule=property&position=content';
    $(document).ready(function (){
        CKEDITOR.config.resize_enabled = false;
        CKEDITOR.config.width = 500;
        CKEDITOR.config.height = 200;
        CKEDITOR.replace( 'description',
        {
            toolbar :
                [['Maximize', '-','Format','Font','FontSize','-','TextColor','BGColor','-','Bold','Italic','Underline','Strike','-','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock', '-','Image','Table','-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ]]
        });
    });

    //add property
    function getCategoryType(obj){
        $.ajax({
            url: ADMIN_URL+'/index.php',
            type: 'GET',
            data: "module=property&option=category&action=getCategoryType&type=" + obj.value,
            error: function(){
                alert('Error!');
            },
            success: function(data){
                $("select[name=cat_id]").html(data);
            }
        });
    }

    function getGeo(obj,forObj){
        if(obj.value>0){
            $.ajax({
                url: ADMIN_URL+'/index.php',
                type: 'GET',
                data: "module=property&option=geo&action=getGeo&geo=" + obj.value,
                error: function(){
                    alert('Error!');
                },
                success: function(data){
                    if(forObj=='city'){
                        $("select[name=geo_id[0]]").html(data);
                        $("select[name=geo_id[1]]").html('<option value="0">Chọn vị trí...</option>');
                    }else if(forObj=='district'){
                        $("select[name=geo_id[1]]").html(data);
                    }

                }
            });
        }else{
            $("select[name=geo_id[1]]").html('<option value="0">Chọn vị trí...</option>');
        }
    }

    function otherLegalDoc(obj){
        if(obj.value=='3'){
            $("input[name=other_legal_doc]").show();
        }else{
            $("input[name=other_legal_doc]").hide();
        }
    }
    function showPrice(){
        //$("input[name=price]").val($("input[name=price]").val().replace(/[^0-9]/g, ''));
        //$("#showPrice").html(addCommasToNumber($("input[name=price]").val().replace(/[^0-9]/g, '')));
        if($("input[name=price]").val()==''){
            $("#showPrice").html(0);
        }else{
            $("#showPrice").html(addCommasToNumber($("input[name=price]").val()));
        }
    }
    function removeImage(id){
        $("#"+id).remove();
    }
    function addCommasToNumber(numberStr){
        numberStr += '';
        x = numberStr.split('.');
        x1 = x[0];
        x2 = x.length > 1 ? '.' + x[1] : '';
        var rgx = /(\d+)(\d{3})/;
        while (rgx.test(x1)) {
            x1 = x1.replace(rgx, '$1' + '.' + '$2');
        }
        return x1 + x2;
    }
    function onlyNumber(htmlInputName){
        $("input[name="+htmlInputName+"]").val(( $("input[name="+htmlInputName+"]").val().replace(/[^0-9]/g, '')));

    }

    function mapFindGeo(){
        var geoName = $("#txtFindGeo").val();
        geocoder.getLocations(geoName, getCoordForAddress);
        return false;
    }

    function onlyFloatNumber(htmlInputName){
        $("input[name="+htmlInputName+"]").val(( $("input[name="+htmlInputName+"]").val().replace(/[^0-9 .]/g, '')));

    }
    $(document).ready(function (){
        //get category type
        $('input[name=type]').click(function (){
            getCategoryType(this);
        });
        //get geographic
        $('input[name=geo]').click(function (){
            getGeo(this,'city');
        });
        $("select[name=geo_id[0]]").change(function(){
            getGeo(this,'district');
        });
        //other legal doc
        $("select[name=legal_doc]").change(function(){
            otherLegalDoc(this);
        });
        //price
        $("input[name=price]").keyup(function(){
            showPrice();
        });
        //area_use
        $("input[name=area_use]").keyup(function(){
            onlyFloatNumber('area_use');
        });
        //area_campus_width
        $("input[name=area_campus_width]").keyup(function(){
            onlyFloatNumber('area_campus_width');
        });
        //area_campus_depth
        $("input[name=area_campus_depth]").keyup(function(){
            onlyFloatNumber('area_campus_depth');
        });
        //area_build
        $("input[name=area_build]").keyup(function(){
            onlyFloatNumber('area_build');
        });
        //room
        $("input[name=room]").keyup(function(){
            onlyNumber('room');
        });
        //bathRoom
        $("input[name=bathroom]").keyup(function(){
            onlyNumber('bathroom');
        });
        //bathRoom
        $("input[name=sittingroom]").keyup(function(){
            onlyNumber('sittingroom');
        });
        //bathRoom
        $("input[name=bedroom]").keyup(function(){
            onlyNumber('bedroom');
        });
        //bathRoom
        $("input[name=kitchen]").keyup(function(){
            onlyNumber('kitchen');
        });
         $("input[name=num_order]").keyup(function(){
            onlyNumber('num_order');
        });
        //floor
        $("input[name=floor]").keyup(function(){
            onlyNumber('floor');
        });

    });
    function submitFormAddProperty(submitType){
        if(submitType=='exit'){
            $("#submitType").val('exit');
            $("#submitFrmPropertyAdd").click();
        }
    }
     function searchAddress(){
        var str=$('#searchMapAddress ').val()+" "+$('#geoDistrict option:selected').text()+" "+$('#geoCity option:selected').text();
        if(str!=' '){
            showAddress(str);
        }
     }
</script>
<div class="container_l">
    <form name="formPropertyAddCategory" method="POST" action="">
        <div class="title_user"><img src="images/icon1.gif" />Quản lý sản phẩm</div>
        <div class="table_user">
            <div class="table_user_in2">
                <?php
                show_error();
                show_success();
                ?>
                <fieldset>
                    <legend accesskey="N">Sản phẩm</legend>
                    <div class="lineaddnew">
                        <div style="width:70%;float:left;">
                            <div class="lineform">
                                <div class="divlabel_news">Kiểu SP:</div>
                                <div style="margin-top:6px;">&nbsp;&nbsp;&nbsp;<label><input type="radio" name="type" value="1" <?php echo setCheckedBoxValue($_REQUEST['type'],'1',true);?> /> Bán</label> &nbsp;&nbsp; <label><input type="radio" name="type" value="2" <?php echo setCheckedBoxValue($_REQUEST['type'],'2');?> /> Cho thuê</label></div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Danh mục: <font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <select name="cat_id">
                                        <?php
                                        if(isset($_REQUEST['cat_id']) && intval($_REQUEST['cat_id'])>0) {
                                            $arrCatId = listPropertyCategoryByParent($_REQUEST['geo']);
                                            echo '<option value="0">Chọn danh mục...</option>';
                                            for($i=0;$i<count($arrCatId);$i++) {
                                                echo '<option '.setSelectedBoxValue($_REQUEST['cat_id'], $arrCatId[$i]['cat_id']).' value="'.$arrCatId[$i]['cat_id'].'">'.$arrCatId[$i]['cat_title'].'</option>';
                                            }
                                        }else {
                                            $arrCatId = listPropertyCategoryByParent(1);
                                            echo '<option value="0">Chọn danh mục...</option>';
                                            for($i=0;$i<count($arrCatId);$i++) {
                                                echo '<option '.setSelectedBoxValue($_REQUEST['cat_id'], $arrCatId[$i]['cat_id']).' value="'.$arrCatId[$i]['cat_id'].'">'.$arrCatId[$i]['cat_title'].'</option>';
                                            }
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>
                             <div class="lineform">
                                <div class="divlabel_news">Tiêu đề: <font color="#FF0000">*</font></div>
                                <div class="divform"><input type="text" id="title" name="title" value="<?php echo htmlentities($_REQUEST['title'], ENT_QUOTES, 'UTF-8');?>" style="width:95%;"/></div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">VT địa lý: <font color="#FF0000">*</font></div>
                                <div style="margin-top:6px;margin-left:115px;">
                                    <label><input type="radio" name="geo" value="1" <?php echo setCheckedBoxValue($_REQUEST['geo'],'1',true);?> /> Miền bắc</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <label><input type="radio" name="geo" value="2" <?php echo setCheckedBoxValue($_REQUEST['geo'],'2');?> /> Miền trung</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <label><input type="radio" name="geo" value="3" <?php echo setCheckedBoxValue($_REQUEST['geo'],'3');?> /> Miền nam</label>
                                    <br>Thành phố:&nbsp;&nbsp;&nbsp;&nbsp; <select id="geoCity" onchange="showAddress($('#geoCity option:selected').text());" name="geo_id[0]" style="margin-top:5px;width:350px">
                                        <?php
                                        $arrGeoId = $_REQUEST['geo_id'];
                                        if(isset($_REQUEST['geo']) && intval($_REQUEST['geo'])>0) {
                                            $arrGeoCity = listAllPropertyGeographicByParent($_REQUEST['geo']);
                                            echo '<option value="0">Chọn thành phố...</option>';
                                            for($i=0;$i<count($arrGeoCity);$i++) {
                                                echo '<option '.setSelectedBoxValue($arrGeoId[0], $arrGeoCity[$i]['geo_id']).' value="'.$arrGeoCity[$i]['geo_id'].'">'.$arrGeoCity[$i]['geo_title'].'</option>';
                                            }
                                        }else {
                                            $arrGeoCity = listAllPropertyGeographicByParent(1);
                                            echo '<option value="0">Chọn thành phố...</option>';
                                            for($i=0;$i<count($arrGeoCity);$i++) {
                                                echo '<option '.setSelectedBoxValue($arrGeoId[0], $arrGeoCity[$i]['geo_id']).' value="'.$arrGeoCity[$i]['geo_id'].'">'.$arrGeoCity[$i]['geo_title'].'</option>';
                                            }
                                        }
                                        ?>
                                    </select>
                                    <br>Quận/Huyện:&nbsp;&nbsp;<select id="geoDistrict" onchange="showAddress($('#geoDistrict option:selected').text()+' '+$('#geoCity option:selected').text());" name="geo_id[1]" style="margin-top:5px;width:350px">
                                        <?php
                                        if(isset($_REQUEST['geo_id']) && intval($arrGeoId[1])>0) {
                                            $arrGeoDistrict = listAllPropertyGeographicByParent($arrGeoId[0]);
                                            echo '<option value="0">Chọn quận/huyện...</option>';
                                            for($i=0;$i<count($arrGeoDistrict);$i++) {
                                                echo '<option '.setSelectedBoxValue($arrGeoId[1], $arrGeoDistrict[$i]['geo_id']).' value="'.$arrGeoDistrict[$i]['geo_id'].'">'.$arrGeoDistrict[$i]['geo_title'].'</option>';
                                            }
                                        }else {
                                            echo '<option value="0">Chọn quận/huyện...</option>';
                                        }
                                        ?>
                                    </select>
                                    <br>Tên đường/Địa điểm:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" id="searchMapAddress" onkeydown="if (event.keyCode == 13){searchAddress();return false;}"  style="margin-top:5px;width:272px"/> <input type="button" onclick="searchAddress();" value="Định vị"/>
                                    <div style="margin-left: 153px;">VD: thap rua, hoang quoc viet, hoc vien tai chinh, duong truong chinh...</div>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Bản đồ:</div>
                                <div class="divform">
                                    <input type="text" id="geocodeRoboGEO" name="map" style="width: 235px;margin-bottom: 5px;display: none;" readonly/>
                                    <div id="map" style="width: 600px; height: 400px"></div>
                                    <script type="text/javascript">
                                        $(document).ready(function (){
                                            load();
                                        });
                                        $(document).unload(function (){
                                            GUnload();
                                        });
                                        function load() {
                                            if (GBrowserIsCompatible()) {
                                                var map = new GMap2(document.getElementById("map"));
                                                map.addControl(new GSmallMapControl());
                                                map.addControl(new GMapTypeControl());
                                                var center = new GLatLng(21.028711,  	105.852456);
                                                map.setCenter(center, 15);
                                                geocoder = new GClientGeocoder();
                                                var marker = new GMarker(center, {draggable: true});
                                                map.addOverlay(marker);
                                                var message = 'latitude: ' + center.lat().toFixed(5) + ', longitude: ' + center.lng().toFixed(5);
                                                document.getElementById("geocodeRoboGEO").value = message;
                                                //document.getElementById("lat").innerHTML = center.lat().toFixed(5);
                                                //document.getElementById("lng").innerHTML = center.lng().toFixed(5);
                                                GEvent.addListener(marker, "dragend", function() {
                                                    var point = marker.getPoint();
                                                    map.panTo(point);
                                                    var message = 'latitude: ' + point.lat().toFixed(5) + ', longitude: ' + point.lng().toFixed(5);
                                                    document.getElementById("geocodeRoboGEO").value = message;
                                                    //document.getElementById("lat").innerHTML = point.lat().toFixed(5);
                                                    //document.getElementById("lng").innerHTML = point.lng().toFixed(5);
                                                });
                                                GEvent.addListener(map, "moveend", function() {
                                                    map.clearOverlays();
                                                    var center = map.getCenter();
                                                    var marker = new GMarker(center, {draggable: true});
                                                    map.addOverlay(marker);
                                                    var message = 'latitude: ' + center.lat().toFixed(5) + ', longitude: ' + center.lng().toFixed(5);
                                                    document.getElementById("geocodeRoboGEO").value = message;
                                                    //document.getElementById("lat").innerHTML = center.lat().toFixed(5);
                                                    //document.getElementById("lng").innerHTML = center.lng().toFixed(5);
                                                    GEvent.addListener(marker, "dragend", function() {
                                                        var point =marker.getPoint();
                                                        map.panTo(point);
                                                        var message = 'latitude: ' + point.lat().toFixed(5) + ', longitude: ' + point.lng().toFixed(5);
                                                        document.getElementById("geocodeRoboGEO").value = message;
                                                        //document.getElementById("lat").innerHTML = point.lat().toFixed(5);
                                                        //document.getElementById("lng").innerHTML = point.lng().toFixed(5);
                                                    });
                                                });
                                            }
                                        }
                                        function findAddress() {
                                            myAddress = document.getElementById("address").value;
                                            geocoder.getLocations(myAddress, getCoordForAddress);
                                        }
                                        function showAddress(address) {
                                            var map = new GMap2(document.getElementById("map"));
                                            map.addControl(new GSmallMapControl());
                                            map.addControl(new GMapTypeControl());
                                            if (geocoder) {
                                                geocoder.getLatLng(
                                                address,
                                                function(point) {
                                                    if (!point) {
                                                        alert("Xin loi, chung toi khong tim thay " + address);
                                                        var message = 'latitude: ' + 21.028711 + ', longitude: ' + 105.852456;
                                                        document.getElementById("geocodeRoboGEO").value = message;
                                                        //document.getElementById("lat").innerHTML = point.lat().toFixed(5);
                                                        //document.getElementById("lng").innerHTML = point.lng().toFixed(5);
                                                        map.clearOverlays()
                                                        map.setCenter(point, 14);
                                                        var marker = new GMarker(point, {draggable: true});
                                                        map.addOverlay(marker);

                                                        GEvent.addListener(marker, "dragend", function() {
                                                            var pt = marker.getPoint();
                                                            map.panTo(pt);
                                                            var message = 'latitude: ' + pt.lat().toFixed(5) + ', longitude: ' + pt.lng().toFixed(5);
                                                            document.getElementById("geocodeRoboGEO").value = message;
                                                            //document.getElementById("lat").innerHTML = pt.lat().toFixed(5);
                                                            //document.getElementById("lng").innerHTML = pt.lng().toFixed(5);
                                                        });


                                                        GEvent.addListener(map, "moveend", function() {
                                                            map.clearOverlays();
                                                            var center = map.getCenter();
                                                            var marker = new GMarker(center, {draggable: true});
                                                            map.addOverlay(marker);
                                                            var message = 'latitude: ' + center.lat().toFixed(5) + ', longitude: ' + center.lng().toFixed(5);
                                                            document.getElementById("geocodeRoboGEO").value = message;
                                                            //document.getElementById("lat").innerHTML = center.lat().toFixed(5);
                                                            //document.getElementById("lng").innerHTML = center.lng().toFixed(5);

                                                            GEvent.addListener(marker, "dragend", function() {
                                                                var pt = marker.getPoint();
                                                                map.panTo(pt);
                                                                var message = 'latitude: ' + pt.lat().toFixed(5) + ', longitude: ' + pt.lng().toFixed(5);
                                                                document.getElementById("geocodeRoboGEO").value = message;
                                                                //document.getElementById("lat").innerHTML = pt.lat().toFixed(5);
                                                                //document.getElementById("lng").innerHTML = pt.lng().toFixed(5);
                                                            });

                                                        });

                                                    } else {
                                                        var message = 'latitude: ' + point.lat().toFixed(5) + ', longitude: ' + point.lng().toFixed(5);
                                                        document.getElementById("geocodeRoboGEO").value = message;
                                                        //document.getElementById("lat").innerHTML = point.lat().toFixed(5);
                                                        //document.getElementById("lng").innerHTML = point.lng().toFixed(5);
                                                        map.clearOverlays()
                                                        map.setCenter(point, 14);
                                                        var marker = new GMarker(point, {draggable: true});
                                                        map.addOverlay(marker);

                                                        GEvent.addListener(marker, "dragend", function() {
                                                            var pt = marker.getPoint();
                                                            map.panTo(pt);
                                                            var message = 'latitude: ' + pt.lat().toFixed(5) + ', longitude: ' + pt.lng().toFixed(5);
                                                            document.getElementById("geocodeRoboGEO").value = message;
                                                            //document.getElementById("lat").innerHTML = pt.lat().toFixed(5);
                                                            //document.getElementById("lng").innerHTML = pt.lng().toFixed(5);
                                                        });


                                                        GEvent.addListener(map, "moveend", function() {
                                                            map.clearOverlays();
                                                            var center = map.getCenter();
                                                            var marker = new GMarker(center, {draggable: true});
                                                            map.addOverlay(marker);
                                                            var message = 'latitude: ' + center.lat().toFixed(5) + ', longitude: ' + center.lng().toFixed(5);
                                                            document.getElementById("geocodeRoboGEO").value = message;
                                                            //document.getElementById("lat").innerHTML = center.lat().toFixed(5);
                                                            //document.getElementById("lng").innerHTML = center.lng().toFixed(5);

                                                            GEvent.addListener(marker, "dragend", function() {
                                                                var pt = marker.getPoint();
                                                                map.panTo(pt);
                                                                var message = 'latitude: ' + pt.lat().toFixed(5) + ', longitude: ' + pt.lng().toFixed(5);
                                                                document.getElementById("geocodeRoboGEO").value = message;
                                                                //document.getElementById("lat").innerHTML = pt.lat().toFixed(5);
                                                                //document.getElementById("lng").innerHTML = pt.lng().toFixed(5);
                                                            });

                                                        });

                                                    }
                                                }
                                            );
                                            }
                                        }
                                    </script>
                                </div>
                            </div>                           
                            <div class="lineform">
                                <div class="divlabel_news">Thư viện ảnh:</div>
                                <div class="divform" style="width:75%;">
                                    <div style="float:left;width:100%;">
                                        <div><input type="button" value="Chọn ảnh" onclick="popupImages('&forModule=property');" class="button" style="width:100px;" /><div style="padding-top:8px">&nbsp;&nbsp;&nbsp;&nbsp;Ảnh đầu tiên sẽ được dùng làm ảnh hiển thị.</div></div>
                                    </div>

                                    <div id="propertyImagesThumb"></div>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Mô tả: <font color="#FF0000">*</font></div>
                                <div class="divform"><textarea id="description" name="description" cols="10" rows="10" style="overflow:hidden;width:99%;"><?php echo $_REQUEST['description'];?></textarea></div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Hướng nhà:</div>
                                <div class="divform">
                                    <select name="direction">
                                        <?php
                                        foreach ($CONFIG['property_direction'] as $key => $value) {
                                            if(isset($_REQUEST['direction']) && $_REQUEST['direction']==$key) {
                                                echo '<option selected="selected" value="'.$key.'">'.$value.'</option>';
                                            }else {
                                                echo '<option value="'.$key.'">'.$value.'</option>';
                                            }
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Giấy tờ:</div>
                                <div class="divform">
                                    <select name="legal_doc" style="width:150px;float:left;">
                                        <?php
                                        $arrLegalDoc = array('Chọn loại giấy tờ...','Sổ đỏ','Sổ hồng','Giấy tờ khác');
                                        foreach ($arrLegalDoc as $key => $value) {
                                            if(isset($_REQUEST['legal_doc']) && $_REQUEST['legal_doc']==$key) {
                                                echo '<option selected="selected" value="'.$key.'">'.$value.'</option>';
                                            }else {
                                                echo '<option value="'.$key.'">'.$value.'</option>';
                                            }
                                        }
                                        ?>
                                    </select>
                                    <input type="text" name="other_legal_doc" style="display:none;float:left;width:300px;height:17px;margin-left:5px;">
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Diện tích sàn:<font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" id="area_build" name="area_build" value="<?php echo $_REQUEST['area_build'];?>"/> m2
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Diện tích sử dụng:</div>
                                <div class="divform">
                                    <input type="text" id="area_use" name="area_use" value="<?php echo $_REQUEST['area_use'];?>"/> m2
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">DT khuôn viên:</div>
                                <div class="divform">
                                    Rộng: <input type="text" id="area_campus_width" name="area_campus_width" value="<?php echo $_REQUEST['area_campus_width'];?>" style="width:104px;"/> m &nbsp;&nbsp; <span style="color:red;">X</span> &nbsp;&nbsp;
                                    Dài: <input type="text" id="area_campus_depth" name="area_campus_depth" value="<?php echo $_REQUEST['area_campus_depth'];?>" style="width:100px;"/> m
                                </div>
                            </div>

                            <div class="lineform">
                                <div class="divlabel_news" style="line-height:15px;">Giá:<font color="#FF0000">*</font></div>
                                <div class="divform">
                                    <input type="text" id="price" name="price" value="<?php echo $_REQUEST['price'];?>" maxlength="20"/> Triệu đồng
                                    <div style="margin-top:10px;">
                                        <div>Giá: <span id="showPrice" style="font-weight:bold;color:green;"><?php if(isset($_REQUEST['price'])) {
                                                    echo $_REQUEST['price'];
                                                }else {
                                                    echo '0';
                                                }?></span> Triệu đồng.</div>
                                    </div>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số phòng:</div>
                                <div class="divform">
                                    <input type="text" id="room" name="room" value="<?php echo $_REQUEST['room'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số phòng khách:</div>
                                <div class="divform">
                                    <input type="text" id="sittingroom" name="sittingroom" value="<?php echo $_REQUEST['bathroom'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số phòng tắm:</div>
                                <div class="divform">
                                    <input type="text" id="bathroom" name="bathroom" value="<?php echo $_REQUEST['bathroom'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số phòng bếp:</div>
                                <div class="divform">
                                    <input type="text" id="kitchen" name="kitchen" value="<?php echo $_REQUEST['kitchen'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số phòng ngủ:</div>
                                <div class="divform">
                                    <input type="text" id="bedroom" name="bedroom" value="<?php echo $_REQUEST['bedroom'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Số tầng:</div>
                                <div class="divform">
                                    <input type="text" id="floor" name="floor" value="<?php echo $_REQUEST['floor'];?>"/> Chỉ nhập số.
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Đường rộng:</div>
                                <div class="divform">
                                    <input type="text" id="way" name="way" value="<?php echo $_REQUEST['way'];?>"/>m
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Năm xây dựng:</div>
                                <div class="divform">
                                    <input type="text" id="build_year" name="build_year" value="<?php echo $_REQUEST['build_year'];?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Năm sửa chữa:</div>
                                <div class="divform">
                                    <input type="text" id="repair_year" name="repair_year" value="<?php echo $_REQUEST['repair_year'];?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Chỗ để ôtô:</div>
                                <div class="divform">
                                    <select name="gara_oto">
                                        <option value="yes">Có</option>
                                        <option value="no">Không</option>
                                    </select>

                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Tổ chức định giá:</div>
                                <div class="divform">
                                    <input type="text" id="org_price" name="org_price" value="<?php echo $_REQUEST['org_price'];?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Ngày định giá:</div>
                                <div class="divform">
                                    <input type="text" readonly onclick="return showCalendar('date_price');" id="date_price" name="date_price" value="<?php echo $_REQUEST['date_price'];?>"/>
                                    <img src="<?php echo ADMIN_IMAGES_URL;?>/calendar.png" onclick="return showCalendar('date_price');">
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Trạng thái:</div>
                                <div class="divform">
                                    <select name="status">
                                        <?php
                                        $arrStatus = array('actived'=>'Kích hoạt','pending'=>'Chờ kích hoạt','closed'=>'Đã hết hàng');
                                        foreach ($arrStatus as $key => $value) {
                                            if(isset($_REQUEST['status']) && $_REQUEST['status']==$key) {
                                                echo '<option selected="selected" value="'.$key.'">'.$value.'</option>';
                                            }else {
                                                echo '<option value="'.$key.'">'.$value.'</option>';
                                            }
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>
                                 <div class="lineform">
                                <div class="divlabel_news">Thứ tự hiển thị:</div>
                                <div class="divform">
                                    <input type="text"  id="num_order" name="num_order" value="<?php echo $_REQUEST['num_order'];?>"/>
                                    
                                </div>
                            </div>
                            <div class="lineform">
                                <div><b>Thông tin liên hệ</b></div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Tên:</div>
                                <div class="divform">
                                    <input type="text" id="contactName" name="contactName"  value="<?php echo isset($_REQUEST['contactName'])!=''?$_REQUEST['contactName']:"Administrator";?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Email:</div>
                                <div class="divform">
                                    <input type="text" id="contactEmail" name="contactEmail" value="<?php echo isset($_REQUEST['contactEmail'])!=''?$_REQUEST['contactEmail']:"gtc@gtcreal.vn";?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Địa chỉ:</div>
                                <div class="divform">
                                    <input type="text" id="contactAddress" name="contactAddress" value="<?php echo $_REQUEST['contactAddress'];?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Điện thoại:</div>
                                <div class="divform">
                                    <input type="text" id="contactPhone" name="contactPhone" value="<?php echo $_REQUEST['contactPhone'];?>"/>
                                </div>
                            </div>
                            <div class="lineform">
                                <div class="divlabel_news">Di động:</div>
                                <div class="divform">
                                    <input type="text" id="contactMobile" name="contactMobile" value="<?php echo $_REQUEST['contactMobile'];?>"/>
                                </div>
                            </div>
                            
                        </div>
                      
                    </div>
                    <div class="spacer1"><span></span></div>
                </fieldset>
                <div class="linesubmit">
                    <input type="hidden" name="submitType" id="submitType" value="">
                    <input type="submit" name="submitFrmPropertyAdd" id="submitFrmPropertyAdd" value="Lưu lại" class="button" />
                    
                    <input type="button" onclick="document.location='?module=property';" value="Thoát" class="button" />
                </div>
            </div>
        </div>
    </form>
</div>
<?php
include "inc/right.php";
include ADMIN_INCLUDE_DIR."/footer.php";
?>